#ifndef _M45PE40_SPI_FLASH_H_
#define _M45PE40_SPI_FLASH_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "mhscpu.h"

#define M45PE40_IDENTIFICATION           0x9F	
#define Dummy_Byte                       0xA5	
	
#define SPI_FLASH_SPI                    SPIM0
#define SPI_FLASH_CS_PIN                 GPIO_Pin_15	
#define SPI_FLASH_CS_PORT                GPIOB		
	
#define M45PE40_SPI_FLASH_CS_LOW()       GPIO_ResetBits(SPI_FLASH_CS_PORT, SPI_FLASH_CS_PIN)
#define M45PE40_SPI_FLASH_CS_HIGH()      GPIO_SetBits(SPI_FLASH_CS_PORT, SPI_FLASH_CS_PIN)
	
void M45PE40_SPI_FLASH_Init(void);
	
uint8_t  M45PE40_SPI_FLASH_SendBytes(uint8_t byte);	
uint32_t M45PE40_SPI_FLASH_ReadID(void);
	
#ifdef __cplusplus
}
#endif	


#endif    ///<_M45PE40_SPI_FLASH_H_
